/*
 * @Author: your name
 * @Date: 2022-01-18 09:10:50
 * @LastEditTime: 2022-01-18 15:26:59
 * @LastEditors: Please set LastEditors
 * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 * @FilePath: \performance-app-jh\src\api\user.js
 */
// 用户管理

let base = config.ip;
let projectName = '/public-uias-back';
import {get, post } from './http.js';

/* 用户管理 开始 */
//根据字典类型获取对应的字典数据
export const listCodeData = (p) => get(`${base}${projectName}/code-public/listCodeData`, p);
//获取用户信息列表数据
export const listUserData = (p) => get(`${base}${projectName}/uias-user/listUserData`, p);
//获取用户详情信息
export const getUiasUserDetail = (p) => get(`${base}${projectName}/uias-user/getUiasUserDetail`, p);
//保存或者修改用户相关信息
export const saveOrEditUser = (p) => post(`${base}${projectName}/uias-user/saveOrEditUser`, p);
//查询机构职位关联表
export const listUiasOrgPost = (p) => get(`${base}${projectName}/uias-org-post/listUiasOrgPost`, p);
//获取角色列表
export const listRoleData = (p) => get(`${base}${projectName}/uias-role/listRoleData`, p);
// 获取(离职、退休、调离)用户信息列表数据
export const listFailureUserData = (p) => get(`${base}${projectName}/uias-user/listFailureUserData`, p);
// 获取(离职、退休、调离)用户详情信息
export const getFailureUiasUserDetail = (p) => get(`${base}${projectName}/uias-user/getFailureUiasUserDetail`, p);
//查询机构树
export const listRecursiveOrgan = (p) => get(`${base}${projectName}/uias-organ/listRecursiveOrgan`, p);

/* 
获取第三方注册信息
mobile 必传,
*/
export const queryUserListByMobile = ({ endDate, mobile, startDate }) =>
    post(`${base}${projectName}/call_external/queryUserListByMobile`, { endDate, mobile, startDate });

/* 
获取验证第三方是否激活
userIds: [],  用户信息
tenantId: '' 租户编码

orgId  业务方用户管理点击验证注册需要传orgId
*/
export const activateYzwAccount = ({ userIds, tenantId, orgId }) =>
    post(`${base}${projectName}/call_external/activateYzwAccount`, { userIds, tenantId, orgId });
/* 用户管理 结束 */